import React,{Component} from 'react'

import {MytaskStyle} from './StyleMytask'
import Navigation from 'components/Navigation/Navigation'
import Titlebar from './components/Titlebar'
import {
    Route,
    withRouter,
    Switch,
    Redirect
  } from 'react-router-dom'

import ht from 'images/my/huitui@3x.png'
import Publish from './Publish'
import Receipt from './Receipt'
import Select  from './Select'


class Mytask extends Component{
    render(props){
        return(
            <MytaskStyle>
                <Navigation 
                    leftImg = {ht} 
                    leftImgWidth = '.2rem'
                    leftImgHeight = '.2rem'
                    leftPadding = '0 0 0 .15rem'
                    title = "我的任务"
                    titleSize = '.17rem'
                    clickLeft = {()=>this.onClickLeft("left")}
                ></Navigation>
                <Titlebar></Titlebar>
                <Switch>
                    <Route path="/myChildRouter/mytask/publish" component={Publish}></Route>
                    <Route path="/myChildRouter/mytask/receipt" component={Receipt}></Route>
                    <Redirect from="/myChildRouter/mytask" exact to="/myChildRouter/mytask/publish"></Redirect>
                </Switch>
            </MytaskStyle>
        )
    }
    onClickLeft(){
        this.props.history.go(-1)
    }
}

export default Mytask